//
//  NSString+Date.m
//  InTime
//
//  Created by zhangjia on 15/9/9.
//  Copyright (c) 2015年 ClownYoJoy. All rights reserved.
//

#import "NSString+Date.h"

@implementation NSString (Date)

+ (instancetype)stringWithTimeInterval:(NSTimeInterval)time {
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:time];
    //设置时区和格式
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    formatter.dateFormat = @"YYYYMMdd";
//    formatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:(NSString *)];
    formatter.timeZone = [NSTimeZone systemTimeZone];//系统当前的时区
    NSString *dateString = [formatter stringFromDate:date];
    return dateString;
}

@end
